package pojo;

import java.io.Serializable;
import lombok.Data;

/**
 * course
 * @author 
 */
@Data
public class Course implements Serializable {
    private String courseid;

    private String coursename;

    private String precourse;

    private String teacherid;

    private String classroomid;

    private Double credit;

    private String courseintroduction;

    private Short coursestateid;

    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Course other = (Course) that;
        return (this.getCourseid() == null ? other.getCourseid() == null : this.getCourseid().equals(other.getCourseid()))
            && (this.getCoursename() == null ? other.getCoursename() == null : this.getCoursename().equals(other.getCoursename()))
            && (this.getPrecourse() == null ? other.getPrecourse() == null : this.getPrecourse().equals(other.getPrecourse()))
            && (this.getTeacherid() == null ? other.getTeacherid() == null : this.getTeacherid().equals(other.getTeacherid()))
            && (this.getClassroomid() == null ? other.getClassroomid() == null : this.getClassroomid().equals(other.getClassroomid()))
            && (this.getCredit() == null ? other.getCredit() == null : this.getCredit().equals(other.getCredit()))
            && (this.getCourseintroduction() == null ? other.getCourseintroduction() == null : this.getCourseintroduction().equals(other.getCourseintroduction()))
            && (this.getCoursestateid() == null ? other.getCoursestateid() == null : this.getCoursestateid().equals(other.getCoursestateid()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getCourseid() == null) ? 0 : getCourseid().hashCode());
        result = prime * result + ((getCoursename() == null) ? 0 : getCoursename().hashCode());
        result = prime * result + ((getPrecourse() == null) ? 0 : getPrecourse().hashCode());
        result = prime * result + ((getTeacherid() == null) ? 0 : getTeacherid().hashCode());
        result = prime * result + ((getClassroomid() == null) ? 0 : getClassroomid().hashCode());
        result = prime * result + ((getCredit() == null) ? 0 : getCredit().hashCode());
        result = prime * result + ((getCourseintroduction() == null) ? 0 : getCourseintroduction().hashCode());
        result = prime * result + ((getCoursestateid() == null) ? 0 : getCoursestateid().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", courseid=").append(courseid);
        sb.append(", coursename=").append(coursename);
        sb.append(", precourse=").append(precourse);
        sb.append(", teacherid=").append(teacherid);
        sb.append(", classroomid=").append(classroomid);
        sb.append(", credit=").append(credit);
        sb.append(", courseintroduction=").append(courseintroduction);
        sb.append(", coursestateid=").append(coursestateid);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}